function selectedindex= uicontrol_SelectedIndex( varargin )
%UICONTROL_SELECTEDINDEX Summary of this function goes here
%   Detailed explanation goes here

h= varargin{1};
switch nargin 
    case 1        
        selectedindex= get(h, 'value');
    case 2
        index2select= varargin{2};
        set(h, 'value', index2select);
end

end

